package com.ruoyi.net.domain;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

public class GroupTreeSelect implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;

    private String label;

    private String parentId;

    private String groupName;

    private String groupIcon;

    private String groupType;

    private Long groupLevel;

    private String displayStatus;

    private Long x;
    private Long y;

    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<GroupTreeSelect> children;

    public GroupTreeSelect() {

    }

    public GroupTreeSelect(NetGroup netGroup) {
        this.id = netGroup.getId();
        this.label = netGroup.getGroupName();
        this.parentId = netGroup.getParentId();
        this.groupName = netGroup.getGroupName();
        this.groupIcon = netGroup.getGroupIcon();
        this.groupLevel = netGroup.getGroupLevel();
        this.groupType = netGroup.getGroupType();
        this.displayStatus = netGroup.getDisplayStatus();
        this.x = netGroup.getX();
        this.y = netGroup.getY();
        this.children = netGroup.getChildren().stream().map(GroupTreeSelect::new).collect(Collectors.toList());
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public List<GroupTreeSelect> getChildren() {
        return children;
    }

    public void setChildren(List<GroupTreeSelect> children) {
        this.children = children;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public String getGroupIcon() {
        return groupIcon;
    }

    public void setGroupIcon(String groupIcon) {
        this.groupIcon = groupIcon;
    }

    public String  getGroupType() {
        return groupType;
    }

    public void setGroupType(String groupType) {
        this.groupType = groupType;
    }

    public Long getGroupLevel() {
        return groupLevel;
    }

    public void setGroupLevel(Long groupLevel) {
        this.groupLevel = groupLevel;
    }

    public Long getX() {
        return x;
    }

    public void setX(Long x) {
        this.x = x;
    }

    public Long getY() {
        return y;
    }

    public void setY(Long y) {
        this.y = y;
    }

    public String getDisplayStatus() {
        return displayStatus;
    }

    public void setDisplayStatus(String displayStatus) {
        this.displayStatus = displayStatus;
    }
}